<template>
  <div class="w-full relative bg-white h-full print-style">
    <div class="flex justify-between w-full text-center items-center pl-60">
      <div class="flex-1 text-center text-[32px]">{{ getSystemConfig('HISNAME') }}</div>
      <BaseBarcode :value="formatData[0]?.barcode" class="w-60 text-right" />
    </div>
    <div class="text-center text-[22px] font-bold">入院通知单</div>
    <div class="w-full flex items-center my-2 !text-[12px] mt-10">
      <div class="flex w-[208px]">
        <div class="mr-5">姓名：{{ formatData[0]?.brName }}</div>
        <div class="mr-5">{{ formatData[0]?.brXb }}</div>
        <div class="mr-5">{{ formatData[0]?.brAge }}岁</div>
      </div>
      <div class="w-[175px]">科室：{{ formatData[0]?.ksmc }}</div>
      <div class="w-[175px]">预约医生：{{ formatData[0]?.yyys }}</div>
      <div>打印：{{ dayjs().format('YYYY-MM-DD HH:mm:ss') }}</div>
    </div>
    <div class="border border-solid border-x-0 border-b-0 mb-3"></div>

    <div class="flex !text-[12px] pl-9">
      <div class="w-[173px]">
        <!-- <div class="mb-3">住院号：{{ formatData[0]?.zyh }}</div> -->
        <div class="mb-3">预约病区：{{ formatData[0]?.bqmccw }}</div>
        <div class="mb-3">责任医生：{{ formatData[0]?.zrys }}</div>
        <div class="mb-3">住院天数：{{ formatData[0]?.zyts }}</div>
      </div>
      <div class="w-[175px]">
        <div class="mb-3">目标床位：{{ formatData[0]?.cwh }}</div>
        <div class="mb-3">住院医生：{{ formatData[0]?.zyys }}</div>
        <div class="mb-3">入院途径：{{ formatData[0]?.rytj }}</div>
      </div>
      <div class="w-[175px]">
        <div class="mb-3">护理等级：{{ formatData[0]?.nurseLevelName }}</div>
        <div class="mb-3">主治医生：{{ formatData[0]?.zzys }}</div>
        <div class="mb-3">手术部位：{{ formatData[0]?.ssbw }}</div>
      </div>
      <div>
        <div class="mb-3">申请入院：{{ formatData[0]?.rysj }}</div>
        <div class="mb-3">主任(副)医生：{{ formatData[0]?.zrfys }}</div>
        <div class="mb-3">押金：￥{{ formatData[0]?.jy || '-' }}</div>
      </div>
    </div>
    <div class="!text-[12px] pl-9" style="margin-bottom: 190px">
      <div class="mb-3 w-full">入院诊断：{{ formatData[0]?.ryzd }}</div>
      <div class="mb-3 w-full">行何手术：{{ formatData[0]?.xhss }}</div>
      <div class="mb-3 w-full">备注：{{ formatData[0]?.memo }}</div>
    </div>
    <div class="absolute bottom-5 left-0">
      <div class="border border-solid border-x-0 border-b-0 mb-3"></div>
      <div class="leading-5 !text-[12px] flex">
        <div>注：</div>
        <div>{{ formatData[0]?.bz }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
import dayjs from 'dayjs'
import { getSystemConfig } from '@/utils/systemConfig'

const props = defineProps({
  printData: {
    type: Object,
    default: () => ({})
  }
})

const formatData = ref([])

watch(
  () => props.printData,
  () => {
    if (props.printData.printData?.detail.length) {
      formatData.value = props.printData.printData?.detail
    }
  }
)
</script>
<style lang="less" scoped></style>
